﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Kaixin.Components
{
    /// <summary>
    /// 日志类
    /// 创建：2009-12-9 14:54:21
    /// 版本：1.0
    /// 作者：吴鸣震
    /// </summary>
    public class Log
    {
        readonly static string LOG_FILE = AppDomain.CurrentDomain.BaseDirectory+ "LOG.TXT";

        public static void WriteLog(string data,string componentName)
        {
            FileInfo file = new FileInfo(LOG_FILE);
            StreamWriter sw;
            if (!file.Exists)
            {
                sw = file.CreateText();
            }
            else
            {
                sw = file.AppendText();
            }
            sw.WriteLine(string.Format("时间【{1}】  组件【{2}】     {0}", data, DateTime.Now, componentName));
            sw.Close();
        }
     
    }
}
